package com.example.consulConsumer.controller;



import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ListOperations;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class ConsumerController {
    @Resource
    private RestTemplate restTemplate;
    @Autowired
    private RedisTemplate redisTemplate;
    @GetMapping("/con-test")
    public String test(){
        final String key="service";

        Object value = redisTemplate.opsForValue().get(key);


        String str = restTemplate.getForObject(value.toString(), String.class);

        return "consumer>>>>"+str;
    }
}
